package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.CopyrightAuctionUserBidding;
import com.sc.nft.entity.CopyrightAuctionUserBiddingDetail;
import com.sc.nft.enums.CopyrightCollectionStatusEnum;
import com.sc.nft.mapper.CopyrightAuctionUserBiddingDetailMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author：LiGen
 * @Package：com.sc.nft.dao
 * @Project：sc_metago
 * @name：CopyrightAuctionDao
 * @Date：2024/9/12 17:39
 * @Filename：CopyrightAuctionDao
 */
@Slf4j
@Repository
public class CopyrightAuctionUserBiddingDetailDao extends ServiceImpl<CopyrightAuctionUserBiddingDetailMapper, CopyrightAuctionUserBiddingDetail> {
    public boolean saveList(List<CopyrightAuctionUserBiddingDetail> saveDetailsList) {
        return baseMapper.saveList(saveDetailsList);
    }

    /**
     * 获取拍卖记录对应的用户道具Id
     *
     * @param copyrightAuctionRecordId
     * @param copyrightAuctionUserBiddingIds
     * @return
     */
    public List<CopyrightAuctionUserBiddingDetail> getList(Long copyrightAuctionRecordId, List<Long> copyrightAuctionUserBiddingIds) {
        LambdaQueryWrapper<CopyrightAuctionUserBiddingDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CopyrightAuctionUserBiddingDetail::getCopyrightAuctionRecordId, copyrightAuctionRecordId);
        lambdaQueryWrapper.in(CopyrightAuctionUserBiddingDetail::getCopyrightAuctionUserBiddingId, copyrightAuctionUserBiddingIds);
        return list(lambdaQueryWrapper);
    }
}
